package com.gegong.vmware.workstation;

public class VMwareWorkstationManagementActions {


    public interface BaseAction {
        String getUri();

        HttpMethod getMethod();
    }

    public enum VM implements BaseAction {

        FIND_ALL_VMS("/vms", HttpMethod.GET),
        COPY_VM("/vms", HttpMethod.POST),
        DELETE_VM("/vms/%s", HttpMethod.DELETE);
        private String uri;

        private HttpMethod method;

        VM(String uri, HttpMethod method) {
            this.uri = uri;
            this.method = method;
        }

        @Override
        public String getUri() {
            return uri;
        }

        @Override
        public HttpMethod getMethod() {
            return method;
        }
    }


    public enum Power implements BaseAction {
        GET_POWER_STATE("/vms/%s/power", HttpMethod.GET),
        CHANGE_POWER_STATE("/vms/%s/power", HttpMethod.PUT);
        private String uri;

        private HttpMethod method;

        Power(String uri, HttpMethod method) {
            this.uri = uri;
            this.method = method;
        }

        @Override
        public String getUri() {
            return uri;
        }

        @Override
        public HttpMethod getMethod() {
            return method;
        }
    }


    public enum NetworkAdapter implements BaseAction {
        FIND_ALL("/vms/%s/nic", HttpMethod.GET);
        private String uri;

        private HttpMethod method;

        NetworkAdapter(String uri, HttpMethod method) {
            this.uri = uri;
            this.method = method;
        }

        @Override
        public String getUri() {
            return uri;
        }

        @Override
        public HttpMethod getMethod() {
            return method;
        }
    }


}
